<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>书籍展示</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="webjars/jquery/3.5.0/jquery.js"></script>
    <script type="text/javascript" th:inline="javascript">

        /*<![CDATA[*/

        // function isDel(){
        //     return alert("是否删除");
        // }

        /*]]>*/
    </script>
    <style type="text/css">
        .img_td{
            width: 172px;
            display: inline-block;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-default navbar-static-top">
    <div class="container">
        <div class="navbar-header">

            <a class="navbar-brand" href="#">数据集的查询系统后台</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <li><a th:href="@{/user/listU}">用户管理</a></li>
                <li class="active"><a th:href="@{/user/book/listB}">书籍管理<span class="sr-only">(current)</span></a></li>
                <li><a th:href="@{/user/coursera/listC}">课程管理</a></li>
                <li><a th:href="@{/select}">资源获取</a></li>
                <li><a th:href="@{/}">返回首页</a></li>
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</nav>
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h2 class="sub-header">书籍管理</h2>
            <div class="div_select1">
                <form action="login_success.html" th:action="@{/user/book/select/list/book}" method="post" id="form_book"
                      name="form_book">

                    <input class="itxt" type="text" placeholder="请输入所属类别" autocomplete="off" tabindex="1" name="bname"
                           id="bname"/>
                    <br/>
                    <br/>
                    <input type="submit" value="查询书籍" class="sub_btn" id="sub_b"/>
                    <!--                    <input type="button" th:onclick="'javascript:isSubmitb();'" value="查询书籍">-->
                </form>
            </div>
            <div class="table-responsive">
                <table class="table table-striped" th:if="${not #lists.isEmpty(listSelectBook)}">
                    <thead>
                    <tr>
                        <th>序号：</th>
                        <th>图片：</th>
                        <th>书名：</th>
                        <th>链接：</th>
                        <th>作者：</th>
                        <th>价格：</th>
                        <th>所属类别：</th>
                        <th>操作:</th>
                        <th>操作:</th>
                    </tr>
                    </thead>
                    <tbody th:each="book:${listSelectBook}">
                    <tr>
                        <td><span th:text="${book.getBId()}"/></td>
                        <td><span class="img_td"><img th:src="${book.getBImg()}"/></span></td>
                        <td><span th:text="${book.getBName()}"/></td>
                        <td><a th:text="书籍链接" th:href="${book.getBLink()}"/></td>
                        <td><span th:text="${book.getBAuthor()}"/></td>
                        <td><span th:text="${book.getBPrice()}"/></td>
                        <td><span th:text="${book.getBLevel()}"/></td>
                        <td><button type="button" class="btn btn-success"><a style="color: black" th:href="@{'update/'+${book.getBId()}}">编辑</a></button></td>
                        <td><button type="button" class="btn btn-danger"><a style="color: black" th:href="@{'delete/'+${book.getBId()}}" onclick="return confirm('确定将此记录删除?')">删除</a></button></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="table-responsive">
                <table class="table table-striped" th:if="${not #lists.isEmpty(bookList)}">
                    <thead>
                    <tr>
                        <th>序号：</th>
                        <th>图片：</th>
                        <th>书名：</th>
                        <th>链接：</th>
                        <th>作者：</th>
                        <th>价格：</th>
                        <th>所属类别：</th>
                        <th>操作:</th>
                        <th>操作:</th>
                    </tr>
                    </thead>
                    <tbody th:each="book:${bookList}">
                    <tr>
                        <td><span th:text="${book.getBId()}"/></td>
                        <td><span class="img_td"><img th:src="${book.getBImg()}"/></span></td>
                        <td><span th:text="${book.getBName()}"/></td>
                        <td><a th:text="书籍链接" th:href="${book.getBLink()}"/></td>
                        <td><span th:text="${book.getBAuthor()}"/></td>
                        <td><span th:text="${book.getBPrice()}"/></td>
                        <td><span th:text="${book.getBLevel()}"/></td>
                        <td><button type="button" class="btn btn-success"><a style="color: black" th:href="@{'update/'+${book.getBId()}}">编辑</a></button></td>
                        <td><button type="button" class="btn btn-danger"><a style="color: black" th:href="@{'delete/'+${book.getBId()}}" onclick="return confirm('确定将此记录删除?')">删除</a></button></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!--<div class="container">-->
<!--<table>-->
<!--    <tr>-->
<!--        <th>序号：</th>-->

<!--        <th>书名：</th>-->
<!--        <th>链接：</th>-->
<!--        <th>作者：</th>-->
<!--        <th>价格：</th>-->
<!--        <th>所属类别：</th>-->
<!--        <th>操作:</th>-->

<!--    </tr>-->

<!--    <tr th:each="book:${bookList}">-->
<!--        <td>-->
<!--            <span th:text="${book.getBId()}"/>-->
<!--        </td>-->
<!--        <td>-->
<!--            <span th:text="${book.getBName()}"/>-->
<!--        </td>-->
<!--        <td>-->
<!--            <a th:text="书籍链接" th:href="'https://www.amazon.cn/'+${book.getBLink()}"/>-->
<!--        </td>-->
<!--        <td>-->
<!--            <span th:text="${book.getBAuthor()}"/>-->
<!--        </td>-->
<!--        <td>-->
<!--            <span th:text="${book.getBPrice()}"/>-->
<!--        </td>-->
<!--        <td>-->
<!--            <span th:text="${book.getBLevel()}"/>-->
<!--        </td>-->

<!--        <td>-->
<!--            <a th:href="@{'update/'+${book.getBId()}}">编辑</a>-->
<!--        </td>-->
<!--        <td>-->
<!--            <a th:href="@{'delete/'+${book.getBId()}}">删除</a>-->
<!--        </td>-->

<!--    </tr>-->

<!--</table>-->
<!--</div>-->
</body>
</html>
